﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using BL;
using System.Xml;

namespace WebsiteBanHang
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        SanPhamBL sanPham = new SanPhamBL();
        protected void Page_Load(object sender, EventArgs e)
        {
            SanPhamDAL sp = new SanPhamDAL();
            ////SanPhamDAL sp = new SanPhamDAL();
            SanPhamBL sanPham = new SanPhamBL();
            string masp = Request.QueryString["MaSanPham"];
            ////if (masp == null)
            ////    sp = sanPham.LaySanPhamTheoMaSP("SP1");
            ////else           

            ////List<SanPhamDAL> dsSanPham = new List<SanPhamDAL>();
            ////SanPhamBL sanPham = new SanPhamBL();
            ////dsSanPham = sanPham.LayDanhSachSanPham();
            sp = sanPham.LaySanPhamTheoMaSP(masp);
            Label1.Text = sp.TenSanPham;
            Label2.Text = Convert.ToString(sp.GiaBan);
            Image1.ImageUrl = "../images/" + sp.HinhAnh;
            Label6.Text = sp.ThongTinMoTa;

            // Create the XmlDocument.
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(sp.ThongSoKyThuat);

            XmlNodeList danhSachNut = doc.SelectNodes("/THONGSOKYTHUAT/THONGSO");
            Repeatertskt.DataSource = danhSachNut;
            Repeatertskt.DataBind();
        }
    }
}